import Vue from "vue";
import Router from "vue-router";

Vue.use(Router);

const router = new Router({
  // mode: "history",
  base: process.env.BASE_URL,
  routes: [
    {
      path: "/",
      name: "login",
      meta: {
        // 添加该字段，表示进入这个路由是需要登录的
        requireAuth: false
      },
      component: () => import("./views/login/login")
    },
    // 历史记录坐标
    {
      path: "/hishory",
      name: "history",
      component: () => import("./views/myPage/history")
    },
    //  主页
    {
      path: "/position",
      name: "position",
      children: [
          //  地图
        {
          path: "map",
          name: "首页",
          children:[
          ],
          meta: {
            // 添加该字段，表示进入这个路由是需要登录的
            showTab:true,
            keepAlive: true,
            requireAuth: false,
          },
          component: () => import("./views/map/map")
        },
        {
          path: "",
          name: "首页",
          meta: {
            showTab:true,
            // 添加该字段，表示进入这个路由是需要登录的
            requireAuth: false,
          },
          component: () => import("./views/map/map")
        },
        {
          //我的
          path: "myPage",
          name: "我的",
          meta: {
            showTab:true,
            // 添加该字段，表示进入这个路由是需要登录的
            requireAuth: false,
          },
          component: () => import("./views/myPage/myPage")
        },
        {
          //人脸识别
          path: "firstPage",
          name: "打卡",
          meta: {
            showTab:true,
            // 添加该字段，表示进入这个路由是需要登录的
            requireAuth: false,
          },
          component: () => import("./views/firstPage/firstPage")
        },
      ],
      component: () => import("./views/position/position")
    },
    {
      path: "/message",
      name: "message",
      meta: {
        // 添加该字段，表示进入这个路由是需要登录的
        requireAuth: false
      },
      component: () => import("./views/user/message")
    }
  ]
  
});

export default router;
